package com.fnn.service.impl;

import com.fnn.entity.User;
import com.fnn.mapper.UserMapper;
import com.fnn.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;


    @Override
    public User selectBySession(String session_id) {
        return userMapper.selectBySession_id(session_id);
    }

    @Override
    public int insertSessionId(String user_email, String session_id) {
        return userMapper.insertUserSessionIdByEmail(user_email,session_id);
    }

    @Override
    public int register(User user) {
        System.out.println("serviceImplRegister");
        return userMapper.insertUser(user);
    }
    @Override
    public User login(User user) {
        return null;
    }

    @Override
    public User selectByEmail(String email) {
        return userMapper.selectByEmail(email);
    }
}
